﻿using furion.blog.Domain.MySQL;
using furion.blog.Domain.Query.Dept;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Domain.IRepositories
{
    public interface IDeptRepository
    {
        /// <summary>
        /// 查询所有
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        Task<List<Dept>> All(DeptDetailQuery query);

        /// <summary>
        /// 通过id查找实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<Dept> FindById(long id);

        /// <summary>
        /// 查询第一个
        /// </summary>
        /// <param name="exp"></param>
        /// <returns></returns>
        Task<Dept> First(Expression<Func<furion.blog.Domain.MySQL.Dept, bool>> exp);

        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="dept"></param>
        /// <returns></returns>
        Task Save(Dept dept);

        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="dept"></param>
        /// <returns></returns>
        Task Update(Dept dept);

        /// <summary>
        /// 统计
        /// </summary>
        /// <param name="exp"></param>
        /// <returns></returns>
        Task<long> Count(Expression<Func<furion.blog.Domain.MySQL.Dept, bool>> exp);
    }
}
